package com.v5ba.server.service.util;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.v5ba.server.service.IUserService;

/**
 * @author yiren
 * @date 2018-08-11
 */
public class Test {
    public static void main(String[] args) {
        ApplicationConfig application = new ApplicationConfig();
        application.setName("yyy1");

        RegistryConfig registry = new RegistryConfig();
        registry.setAddress("127.0.0.1:2181");
        registry.setProtocol("zookeeper");

        ReferenceConfig<IUserService> reference = new ReferenceConfig();
        reference.setRegistry(registry);
//            reference.setCheck(false);
        reference.setGroup("server-a");
        reference.setApplication(application);
        reference.setInterface(IUserService.class);
        reference.setVersion("1.0.0");
        IUserService userService = reference.get();
        userService.addUser("张三", "18611912657");
    }
}
